package com.scott.ch120;

/**
 * @author 黄后林
 * @version 1.0
 * @note
 * @date 2021-12-18 22:50:10
 */
public class Client {

    public static void main(String[] args) {

        RoleService<Number> service1 = new RoleService<>();
        service1.setData(100);
        print(service1);

        RoleService<Integer> service2 = new RoleService<>();
        service2.setData(200);
        print(service2);

    }

    // 泛型统配符的上限 可以传Number或Number的子类
    public static void  print(RoleService<? extends Number> service) {
        Number data = service.getData();
        System.out.println(data);
    }
}
